<?php
/**
 * Created by PhpStorm.
 * User: MrHung
 * Date: 7/2/14
 * Time: 4:26 PM
 */
session_start();
error_reporting(0);
if (
    isset ( $_POST['title'] )
    && isset ( $_POST['sort'] )
    && isset ( $_POST['id'] )
    && isset($_POST['hash_tag'])
) {
    $_POST['id'] = is_numeric($_POST['id']) ? $_POST['id'] : die();
    $_POST['title'] = trim( $_POST['title'] );

        //<---  * REQUIRE * ----->
        require_once('../../class_ajax_request/classAjaxAdmin.php');
        include_once('../../application/functions.php');
        include_once('../../application/DataConfig.php');



        //INSTANCE
        $obj = new AjaxRequestAdmin();

        //UPDATE BD
        $res = $obj->editCategory();

        if( $res == 1 ) {
            $response = array(
                'success'=>true,
                'message'=>'Edit category success!'
            );
        } else{
            $response = array(
                'success'=>false,
                'message'=>'Edit category fail!'
            );
        }
    echo json_encode($response);die;

}// END IF SESSION ACTIVE